package com.shop.cereshop.agent.controller.voucher;

import com.shop.cereshop.agent.service.voucher.AgentFeeStandardService;
import com.shop.cereshop.commons.domain.voucher.AgentFeeStandard;
import com.shop.cereshop.commons.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/fee")
@Api(value = "代理商收费标准", tags = "代理商收费标准")
@Slf4j(topic = "AgentFeeStandardController")
public class AgentFeeStandardController {
    @Autowired
    private AgentFeeStandardService agentFeeStandardService;

    @ApiOperation(value = "获取代理商收费标准接口")
    @GetMapping("/list")
    public Result<List<AgentFeeStandard>> getList(@RequestParam(value = "search", required = false) @ApiParam(value = "搜索关键词") String search,
                                                  @RequestParam(value = "page") @ApiParam(value = "页码", required = true) Integer page,
                                                  @RequestParam(value = "pageSize") @ApiParam(value = "每页数量", required = true) Integer pageSize) {
        return Result.success(agentFeeStandardService.getList(search, page, pageSize));
    }
}